﻿using System.Windows;

namespace GlobalizationTools.UI
{
    public class UIHelper
    {
        public static T FindParent<T>(DependencyObject value)
            where T : DependencyObject
        {
            while (value != null && !(value is T))
            {
                value = LogicalTreeHelper.GetParent(value);
            }
            return (T)value;
        }
    }
}
